import os

class Config:
    # 数据库配置
    SQLALCHEMY_DATABASE_URI = 'sqlite:///mall.db'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    
    # JWT配置
    JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', 'your-secret-key')
    JWT_ACCESS_TOKEN_EXPIRES = 24 * 60 * 60  # 24小时
    
    # 其他配置
    DEBUG = True
    SECRET_KEY = os.environ.get('SECRET_KEY', 'dev')
    
    # CORS配置
    CORS_HEADERS = 'Content-Type'
    CORS_ORIGINS = ['http://localhost:*', 'http://127.0.0.1:*']
    # CORS_ORIGINS = ['http://localhost:3000', 'http://127.0.0.1:3000', 'http://localhost:16724', 'http://127.0.0.1:16724', 'http://localhost:50818', 'http://127.0.0.1:50818']
    CORS_METHODS = ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
    CORS_ALLOW_HEADERS = ['Content-Type', 'Authorization', 'Origin', 'Accept']